﻿using System;
using System.Collections.Generic;
using System.Text;
using Core.Model;
using Core.Parser.ASN1Parser.Nodes;

namespace Core.Parser.ASN1Parser.Builders
{
    internal class AudioBuilder
    {
        internal static Audio Build(TaggedNode node, Group group)
        {
            var audio = new Audio();
            IngredientBuilder.Build(node, audio, group);

            TaggedNode e;

            if ( ( e = node[ASN1ContextCodes.C_COMPONENT_TAG]) != null)
                audio.ComponentTag = e.First.IntValue;

            if ( ( e = node[ASN1ContextCodes.C_ORIGINAL_VOLUME]) != null)
                audio.OriginalVolume = e.First.IntValue;

            return audio;
        }

    }
}
